<ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:p="http://primefaces.org/ui"
            xmlns:f="http://java.sun.com/jsf/core"
            template="/mytemplate.xhtml">

    <ui:define name="metadata">
    </ui:define>
    <ui:define name="content">
        <h:form id="findingForm">
            <p:growl id="growl" showDetail="true" sticky="true" />
            <p:panelGrid columns="2">
                <f:facet name="header">
                    Selecting connected and connecting net elements
                </f:facet>
                <p:column>
                    <p:dataTable var="equip" value="#{equipmentFindingService.equipmentsDM}" 
                                 selection="#{equipmentFindingService.leftSelectedEquipment}"
                                 paginator="true" rows="10" 
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
                        <f:facet name="header">
                        Source Equipment
                        </f:facet>    
                        <p:column selectionMode="single" />
                        <p:column sortBy="#{equip.name}" headerText="Name">
                            <h:outputText value="#{equip.name}"/>
                        </p:column>
                        <p:column sortBy="#{equip.type}" headerText="Type">
                            <h:outputText value="#{equip.type}"/>
                        </p:column>
                        <p:column sortBy="#{equip.address}" headerText="Address">
                            <h:outputText value="#{equip.address}"/>
                        </p:column>                 
                    </p:dataTable>
                </p:column>
                <p:column>
                    <p:dataTable var="equip" value="#{equipmentFindingService.equipmentsDM}" 
                                 selection="#{equipmentFindingService.rightSelectedEquipment}"
                                 paginator="true" rows="10" 
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
                        <f:facet name="header">
                        Destination Equipment
                        </f:facet>
                        <p:column selectionMode="single" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                        <p:column sortBy="#{equip.name}" headerText="Name">
                            <h:outputText value="#{equip.name}"/>
                        </p:column>
                        <p:column sortBy="#{equip.type}" headerText="Type">
                            <h:outputText value="#{equip.type}"/>
                        </p:column>
                        <p:column sortBy="#{equip.address}" headerText="Address">
                            <h:outputText value="#{equip.address}"/>
                        </p:column>
                    </p:dataTable>
                </p:column>
                <f:facet name="footer">
                </f:facet>
            </p:panelGrid>
            <p:commandButton value="Find Path"
                            update="findingGrid"
                            actionListener="#{equipmentFindingService.find()}"/>
            <p:panelGrid columns="1" id="findingGrid">
                <f:facet name="headerFoundGrid">
                    Found Path
                </f:facet>
                <p:dataTable id="foundPath" var="ent" value="#{equipmentFindingService.listEntities}">
                    <p:column sortBy="#{ent.strType}" headerText="Type">
                        <h:outputText value="#{ent.strType}" />  
                    </p:column> 
                    <p:column sortBy="#{ent.name}" headerText="Name">
                        <h:outputText value="#{ent.name}" />  
                    </p:column> 
                </p:dataTable>
            </p:panelGrid>
        </h:form> 
    </ui:define>
</ui:composition>